<!DOCTYPE html>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="resource/js/jquery-1.11.1.min.js"></script>
<script src="resource/js/index.js"></script>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body >
        <script>
            var gg=cookieUtil.get("sid");
            if(getcookiestatus()!="1"){
                window.location.href='index.html';
            }
        </script>
        <div class="top">
            <div class="top_content"><p style="font-size: 25px;color: #ffffff;margin-left: 20px;height: 50px;line-height: 50px;overflow: hidden;">系统设置</p></div>
        </div>

        <div  class="left">
            <ul id="bars">
                <li no="0" class="dq" ><a href="#;" id="bar_status">当前状态</a></li>
                <li no="1" ><a href="#;" id="bar_setup">网络设置</a></li>
                <li no="2" ><a href="#;" id="bar_wifi">无线设置</a></li>
                <li no="3" ><a href="#;" id="bar_hulian">互连设置</a></li>
                <li no="4" ><a href="#;" id="bar_serial">串口设置</a></li>
                <li no="5" ><a href="#;" id="bar_directconnect">直连设置</a></li>
                <li no="6" ><a href="#;" id="bar_simulate">网络模拟</a></li>
                <li no="4" ><a href="#;" id="bar_pass">密码修改</a></li>
                <li no="8"><a href="#;" id="bar_quit">退出</a></li>

            </ul>
        </div>


        <div class="right ">
            <div id="status1">
                <h3 style="border-bottom: 1px groove;font-weight:normal; " >设备状态：</h3>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">设备名称：</span><span id="route_name"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">LAN口IP：</span><span id="lan_ip"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">WAN口MAC：</span><span id="mac"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">WIFI类型：</span><span id="wifi_status"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">WIFI名称：</span><span id="ssid"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">WIFI密码：</span><span id="wifi_passwd"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">设备ID：</span><span id="hulian_id"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">直连模式：</span><span id="directconnect"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">互连状态：</span><span id="hlzts"></span></div>
                <div class="con_li"><span style="display: block;float: left;width: 200px;">版本：</span><span id="version"></span></div>


                <br/>
                <h3 style="border-bottom: 1px groove;font-weight:normal;" >Wan口状态：</h3>
                <div class="con_li"><span span style="display: block;float: left;width: 200px;">Internet接入状态：</span><b id="wan_state"></b>
                </div>

                <div id="wan_status">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">WAN口IP：</span><span id="wan_ip"></span></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">子网掩码：</span><span id="wan_mask"></span></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">网关：</span><span id="wan_gateway"></span></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">DNS1：</span><span id="wan_dns1"></span></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">DNS2：</span><span id="wan_dns2"></span></div>
                </div>

                <div id="wwan_status">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">WWAN口IP：</span><span id="wwan_ip"></span></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">网关：</span><span id="wwan_gateway"></span></div>
                </div>

                <br/>
                <div ><button id="f5button" style="width:100px;height:25px;margin-left: 450px">刷新</button></div>

            </div>

            <div id="net_setup" style="display: none">
                <h3 style="border-bottom: 1px groove;font-weight:normal; " >Wan口接入设置：</h3><br/>
                <div class="con_li">
                    <span style="display: block;float: left;width: 200px;">连接类型：</span>
                    <b>
                        <select id="wan_proto" onchange="javascript:SelectChangewan();"  style="height:30px; margin-top:5px; width:145px";>
                            <option value="static">静态IP(手动获取)</option>
                            <option value="dhcp" selected="selected">自动获取IP(DHCP)</option>
                            <option value="pppoe">PPPOE(虚拟拨号)</option>
                            <option value="3g">4G</option>
                            <option value="disablewan">禁用</option>
                        </select>
                    </b>
                </div>
                <div id="static_status">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">ip地址：</span> <input type="text"  id="wan_static_ip" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">子网掩码：</span> <input type="text"  id="wan_static_mask" style="width:140px;height:20px;font-family:微软雅黑;;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">网关：</span> <input type="text"  id="wan_static_gateway" style="width:140px;height:20px;font-family:微软雅黑 ;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">DNS1：</span> <input type="text"  id="wan_static_dns1" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">DNS2：</span> <input type="text"  id="wan_static_dns2" style="width:140px;height:20px;font-family:微软雅黑 ;"></div>
                </div>
                <div id="pppoe_status">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">用户名：</span> <input type="text"  id="pppoe_user" style="width:140px;height:20px;font-family:微软雅黑 ;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">密码：</span> <input type="text"  id="pppoe_pass" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                </div><br/>
                <div ><button id="settingbutton" style="width:100px;height:25px;margin-left: 450px">保存</button></div>
            </div>



            <div id="wifi_setup" style="display: none">
                <h3 style="border-bottom: 1px groove;font-weight:normal; " >无线设置：</h3><br/>
                <div class="con_li">
                    <span style="display: block;float: left;width: 200px;">无线类型：</span>
                    <b>
                        <select id="wifi_proto" onchange="javascript:SelectChangewifi();"  style="height:30px; margin-top:5px; width:145px";>
                            <option value="wifi_ap" selected="selected">无线访问点(ap)</option>
                            <option value="wifi_client" >无线客户端(client)</option>
                            <option value="wifi_none">禁用无线</option>
                        </select>
                    </b>
                    <span id="showscanbutton"><button id="scanbutton" style="width:100px;height:25px;margin-left: 45px">扫描无线</button></span>
                </div>




                <div id="wifi_ap">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">SSID</span> <input type="text" id="wifi_ssid" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">加密方式：</span>
                        <b>
                            <select id="wifi_encrypt" style="height:30px; margin-top:5px; width:145px" ;>
                                <option value="wifi_psk">WPA-PSK</option>
                                <option value="wifi_psk2" selected="selected">WPA2-PSK</option>
                                <option value="wifi_mix">WPA-PSK/WPA2-PSK Mixed</option>
                            </select>
                        </b>
                    </div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">密码：(至少8位)</span> <input type="text"  id="wifi_pass" style="width:140px;height:20px;font-family:微软雅黑 ;"></div>

                </div>
                <div id="wifi_client">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">ESSID：</span> <input type="text"  id="wifi_client_ssid" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">密码：</span> <input type="text"  id="wifi_client_pass" style="width:140px;height:20px;font-family:微软雅黑 ;"></div>
                </div><br/>


                <div id="wwan_setup">
                    <h4 class="con_li" style="border-bottom: 1px groove;font-weight:normal; ">WWAN（无线WAN口）设置：</h4>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">WWAN口MAC</span> <input
                            type="text" id="wwan_mac" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    <div class="con_li">
                        <span style="display: block;float: left;width: 200px;">接入方式：</span>
                        <b>
                            <select id="wwan_proto" onchange="javascript:SelectChangeWwan();"
                                    style="height:30px; margin-top:5px; width:145px" ;>
                                <option value="dhcp" selected="selected">自动获取IP地址</option>
                                <option value="static">静态地址(手工输入)</option>
                            </select>
                        </b>
                    </div>
                    <div id="wwan_show_ip">

                        <div class="con_li"><span style="display: block;float: left;width: 200px;">WWAN口IP</span> <input
                                type="text" id="wwan_ip2" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                        <div class="con_li"><span style="display: block;float: left;width: 200px;">WWAN口网关</span> <input
                                type="text" id="wwan_gateway2" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                        <div class="con_li"><span style="display: block;float: left;width: 200px;">DNS1</span> <input
                                type="text" id="wwan_dns1" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                        <div class="con_li"><span style="display: block;float: left;width: 200px;">DNS2</span> <input
                                type="text" id="wwan_dns2" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    </div>
                </div><br/>
                <div ><button id="wifibutton" style="width:100px;height:25px;margin-left: 450px">保存</button></div>

                <br/>
                <br/>
                <div id="wifi_list">


                </div>
            </div>

            <div id="hulian_setup" style="display: none">
                <h3 style="border-bottom: 1px groove;font-weight:normal; " >互联设置：</h3><br/>

                <div id="hulian_status">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">设备ID：</span> <span  id="hulian_id2" style="width:140px;height:20px;font-family:微软雅黑;"></span></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">互连密码：</span> <input type="text"  id="hulian_pass" style="width:140px;height:20px;font-family:微软雅黑;;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">MTU：</span> <input type="text"  id="mtu" style="width:140px;height:20px;font-family:微软雅黑 ;"></div>

                </div><br/>
                <div ><span><button class="rebootbutton" style="width:100px;height:25px;margin-left: 50px">重启</button><button id="hulianbutton" style="width:100px;height:25px;margin-left: 350px">保存</button></span></div>

            </div>

            <div id="pass_setup" style="display: none">
                <h3 style="border-bottom: 1px groove;font-weight:normal; " >修改密码：</h3><br/>

                <div id="pass_status">
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">新密码：</span> <input type="text"  id="pass1" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">密码确认：</span> <input type="text"  id="pass2" style="width:140px;height:20px;font-family:微软雅黑;;"></div>

                </div><br/>
                <div ><span><button class="rebootbutton" style="width:100px;height:25px;margin-left: 50px">重启</button><button id="passbutton" style="width:100px;height:25px;margin-left: 350px">保存</button></span></div>

            </div>

            <div id="serial_setup" style="display: none">
        <h3 style="border-bottom: 1px groove;font-weight:normal; " >串口服务器设置：</h3><br/>
        <div id="serial_status">
            <div class="con_li"><span style="display: block;float: left;width: 200px;">串口服务器端口：</span> <input type="text"  id="serial_port" style="width:140px;height:20px;font-family:微软雅黑;"></div>
            <div class="con_li">
                <span style="display: block;float: left;width: 200px;">波特率：</span>
                <b>
                    <select id="serial_rate"   style="height:30px; margin-top:5px; width:145px";>
                        <option value="110" >110</option>
                        <option value="300" >300</option>
                        <option value="1200">1200</option>
                        <option value="2400">2400</option>
                        <option value="4800">4800</option>
                        <option value="9600" selected="selected">9600</option>
                        <option value="19200">19200</option>
                        <option value="38400">38400</option>
                        <option value="57600">57600</option>
                        <option value="115200">115200</option>
                        <option value="230400">230400</option>
                        <option value="256000">256000</option>
                    </select>
                </b>
            </div>

            <div class="con_li">
            <span style="display: block;float: left;width: 200px;">数据位：</span>
            <b>
                <select id="serial_bit"   style="height:30px; margin-top:5px; width:145px";>
                    <option value="5" >5</option>
                    <option value="6" >6</option>
                    <option value="7" >7</option>
                    <option value="8" selected="selected">8</option>
                </select>
            </b>
        </div>

            <div class="con_li">
                <span style="display: block;float: left;width: 200px;">奇偶校验：</span>
                <b>
                    <select id="serial_parity"   style="height:30px; margin-top:5px; width:145px";>
                        <option value="NONE" selected="selected">无</option>
                        <option value="ODD" >奇校验</option>
                        <option value="EVEN" >偶校验</option>
                    </select>
                </b>
            </div>

            <div class="con_li">
                <span style="display: block;float: left;width: 200px;">停止位：</span>
                <b>
                    <select id="serial_stop"   style="height:30px; margin-top:5px; width:145px";>
                        <option value="1" selected="selected">1</option>
                        <option value="2" >2</option>

                    </select>
                </b>
            </div>
            <br/>

            <iframe width="20px" name="server"  style="display:none;" src=' '></iframe>
            <form    method="POST" action="/cgi-bin/serial" target="server">
                <input id="serialbutton" type="submit" value="确定" style="width:100px;height:25px;margin-left: 450px">
            </form>

        </div>

    </div>

            <div id="simulate_setup" style="display: none">
                <h3 style="border-bottom: 1px groove;font-weight:normal; " >网络模拟：</h3><br/>

                <div id="simulate_status">
                    <script language=javascript>
                        function onlyNum()
                        {
                            if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)||event.keyCode==8))
                                event.returnValue = false;
                        }
                        function onlyNum2()
                        {
                            if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)||event.keyCode==8||event.keyCode==110))
                                event.returnValue = false;
                        }
                        function less10()
                        {
                            if (parseInt($("#simulate_delay").val()) > 500 ) {
                                document.getElementById("simulate_delay").value = "";
                                alert("延迟输入范围为0－500");
                                event.returnValue = false;
                            }
                            if (parseInt($("#simulate_f").val()) > 100 ) {
                                document.getElementById("simulate_f").value = "";
                                alert("延迟波动输入范围为0－100");
                                event.returnValue = false;
                            }
                            if (parseInt($("#simulate_loss").val()) > 10 ) {
                                document.getElementById("simulate_loss").value = "";
                                alert("掉包输入范围为0－10");
                                event.returnValue = false;
                            }

                            }
                    </script>

                    <div class="con_li"><span style="display: block;float: left;width: 200px;">延迟：</span> <input onkeyup="less10();" onkeydown="onlyNum();" type="text"  id="simulate_delay" style="width:140px;height:20px;font-family:微软雅黑;;">毫秒</div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">延迟波动：</span> <input onkeyup="less10();" onkeydown="onlyNum();" type="text"  id="simulate_f" style="width:140px;height:20px;font-family:微软雅黑 ;">毫秒</div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">掉包率：</span> <input onkeyup="less10();" onkeydown="onlyNum2();" type="text"  id="simulate_loss" style="width:140px;height:20px;font-family:微软雅黑 ;">%</div>
                    <div class="con_li"><span style="display: block;float: left;width: 200px;">带宽：</span> <span   id="simulate_daikuan" style="width:140px;height:22px;font-family:微软雅黑;"></span>不限</div>

                   <br/>
                    <iframe width="20px" name="server2"  style="display:none;" src=' '></iframe>
                    <form    method="POST" action="/cgi-bin/simulate" target="server2">
                        <span><button class="rebootbutton" style="width:100px;height:25px;margin-left: 50px">重启</button><input id="simulatebutton" type="submit" value="开始模拟" style="width:100px;height:25px;margin-left: 350px"></span>
                    </form>
                </div><br/>


            </div>


            <div id="directconnect_setup" style="display: none">
                <h3 style="border-bottom: 1px groove;font-weight:normal; " >直连设置：</h3><br/>

                <div id="directconnect_status">

                    <div class="con_li">
                        <span style="display: block;float: left;width: 200px;">状态：</span>
                        <b>
                            <select id="vpn_proto"  onchange="javascript:SelectChangevpn();" style="height:30px; margin-top:5px; width:145px";>
                                <option value="none" selected="selected">禁用</option>
                                <option value="vpnserver" >服务器</option>
                                <option value="vpnclient" >客户端</option>

                            </select>
                        </b>
                    </div>

                    <div id="vpnip" class="con_li"><span style="display: block;float: left;width: 200px;">服务器地址：</span> <input type="text"  id="vpnserverip" style="width:140px;height:20px;font-family:微软雅黑;"></div>
                    <div  id="vpnport" class="con_li"><span style="display: block;float: left;width: 200px;">服务器端口：</span> <input type="text"  id="vpnserverport" style="width:140px;height:20px;font-family:微软雅黑;;"></div>

                </div><br/>

                <iframe width="20px" name="server"  style="display:none;" src=' '></iframe>
                <form    method="POST" action="/cgi-bin/directconnectbutton" target="server">
                    <input id="directconnectbutton" type="submit" value="确定" style="width:100px;height:25px;margin-left: 450px">
                </form>


            </div>





        </div>

            <script>
                showstatus();
            </script>
</body>
</html>